package org.flyby.api.daoImpl;

import com.google.common.collect.Maps;
import org.flyby.api.dao.UserDao;
import org.flyby.api.persistence.User;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public class UserDaoImpl extends BaseCommonDaoImpl<User> implements UserDao {


    @Override
    public User findByUserNameAndPassword(String userName, String password) {
        Map<String, Object> parameters = Maps.newHashMap();
        parameters.put("userName", userName);
        parameters.put("password", password);
        return executeFirstResultNamedQuery("User.findByUserNameAndPassword", parameters);
    }
}
